package cc.mrbird.demo.config;

import cc.mrbird.demo.domain.User;
import org.springframework.context.annotation.*;

/**
 * @author: chenhs
 * @date: Created in 6:50 2020/3/16
 **/
@Configuration
//@ComponentScan(value = "com.example.demo",
/*    excludeFilters = {
        @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class, Repository.class}),
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = User.class)
    },*/
/*
    includeFilters = {
        @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Service.class)
    },
    useDefaultFilters = false*/
/*    excludeFilters = {
            @ComponentScan.Filter(type = FilterType.CUSTOM, classes = MyTypeFilter.class)
    }*/
//)
public class WebConfig {
    @Bean
    //@Lazy
    @Conditional(value = MyCondition.class)
    public User user(){
        System.out.println("往IOC容器中注册user bean");
        return new User("mrbird", 18);
    }

}
